<div class="right-plate">
    <div class="table-thead">
        <p-treeTable [value]="files" [lazy]="true" (onNodeExpand)="onNodeExpand($event)">
            <ng-template pTemplate="header">
                <tr class="tableStyle_thead_tr">
                    <th class="bs-checkbox w5 text-center">
                        <input type="checkbox" #event (click)="_selectAll(event.checked,files)" [checked]="isSelectAll">
                    </th>
                    <th class="w15 text-left max-w">任务名称</th>
                    <th class="w15 text-left max-w">分配主题词表</th>
                    <th class="w10 text-left max-w">标引人</th>
                    <th class="w10 test-left max-w">审核者</th>
                    <th class="w7 text-left max-w">内容数量</th>
                    <th class="w7 text-left max-w">已标完量</th>
                    <th class="w7 test-left max-w">已审核量</th>
                    <th class="w7 text-left max-w">审核状态</th>
                    <!-- <th class="w10 test-left max-w">审核时间</th> -->
                    <th class="w12 test-left max-w">创建时间</th>
                    <th class="w15 test-left max-w">操作</th>
                </tr>
            </ng-template>
        </p-treeTable>
    </div>

    <div class="table-tbody">
        <p-treeTable [value]="files" [lazy]="true" (onNodeExpand)="onNodeExpand($event)">
            <ng-template pTemplate="body" let-rowNode let-rowData="rowData" let-i="index">
                <tr class="treegrid-2 treegrid-collapsed">
                    <td class="bs-checkbox w5 text-center">
                        <input type="checkbox" #event (click)="_chose(event.checked,rowData.taskId,files.length)" [checked]="isChose">
                    </td>
                    <td class="w15 text-left max-w" title="{{rowData.name}}">
                        <p-treeTableToggler [rowNode]="rowNode" (onNodeExpand)="onNodeExpand($event)"></p-treeTableToggler>
                        {{rowData.name}}
                    </td>
                    <td class="w15 text-left max-w" *ngIf="rowData.idxTaskThemeTableList && rowData.idxTaskThemeTableList.length>0" title="{{rowData.themeWordTableNames}}">
                        <span *ngFor="let child of rowData.idxTaskThemeTableList">
                            <span>{{child.themeWordTableName}}</span>&nbsp;
                        </span>
                    </td>
                    <td class="w15 text-left max-w" *ngIf="!rowData.idxTaskThemeTableList || !rowData.idxTaskThemeTableList.length>0">
                        <span class="stateRed">没有主题词</span>
                    </td>
                    <td class="w10 text-left max-w" *ngIf="rowData.idxTaskAssignList && rowData.idxTaskAssignList.length>0" title="{{rowData.taskAssignBys}}">
                        <span *ngFor="let child of rowData.idxTaskAssignList">
                                    <span>{{child.taskAssignBy}}</span>&nbsp;
                        </span>
                    </td>
                    <td class="w10 text-left max-w" *ngIf="!rowData.idxTaskAssignList || !rowData.idxTaskAssignList.length>0">
                        <span class="stateRed">没有标引人</span>
                    </td>
                    <td class="w10 text-left max-w">
                        <span *ngIf="rowData.taskCheckBy">{{rowData.taskCheckBy}}</span>
                        <span class="stateRed" *ngIf="!rowData.taskCheckBy">没有审核者</span>
                    </td>
                    <td class="w7 text-left max-w">{{rowData.productCount}}</td>
                    <td class="w7 text-left max-w">{{rowData.completeCount}}</td>
                    <td class="w7 text-left max-w">{{rowData.checkCount}}</td>
                    <td class="w7 text-left max-w">
                        <span class="TC-state TC-right-foot-green01" *ngIf="rowData.checkStatus == 200">已通过</span>
                        <span class="TC-state TC-right-foot-orange" *ngIf="rowData.checkStatus == 0">未审核</span>
                        <span class="TC-state TC-right-foot-orange" *ngIf="rowData.checkStatus == -1">未通过</span>
                    </td>
                    <!-- <td class="w10 text-left max-w">{{rowData.checkCompleteDate| date:'yyyy-MM-dd HH:mm:ss'}}</td> -->
                    <td class="w12 text-left max-w">{{rowData.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td class="w15 text-left max-w">
                        <span title="任务内容" class="btn-i" *ngIf="right['taskPermissionList']['InnertextTaskContent']" 
                            routerLink="/product/content" 
                            [queryParams]="{taskId:rowData.taskId,parentId:rowData.parentId,taskType:taskType, completeStatus: rowData.completeStatus,child:rowData.child,projectId:rowData.projectId}"
                            (click)="initService._init(1)"
                         >
                            <img src="assets/new/content.png" width="20px" height="20px">
                        </span>
                        <span title="新增子任务" class="btn-i" data-toggle="modal" data-target="#productTastListAdd" *ngIf="rowData.completeStatus!=1 && right['taskPermissionList']['addChild']" (click)="setData(rowData,'addChildTask');initService._init(1)">
                            <img src="assets/new/add.png" width="14px" height="14px">
                        </span>
                        <span title="编辑" class="btn-i" data-toggle="modal" data-target="#productTastListAdd" *ngIf="rowData.completeStatus!=1 && right['taskPermissionList']['update']" (click)="setData(rowData,'edit');initService._init(1)">
                            <img src="assets/new/update.png" width="14px" height="14px">
                        </span> 
                        <span title="查看" class="btn-i" data-toggle="modal" data-target="#productTastListAdd" *ngIf="rowData.completeStatus==1 && right['taskPermissionList']['details']" (click)="setData(rowData,'detail');initService._init(1)">
                            <img src="assets/new/look.png" width="18px" height="18px">
                        </span> 
                        <span title="删除" class="btn-i" data-toggle="modal" data-target="#productTastListDelete"  *ngIf="(rowData.submitStatus==0 && rowData.completeStatus!=1) && (right['taskPermissionList']['delete'])" (click)="taskDel.setData(rowData);initService._init(1)">
                            <img src="assets/new/delete.png" width="15px" height="15px">
                        </span> 
                        
                        <!-- <span class="tableOperationText" data-toggle="modal" data-target="#productTastListDelete"  (click)="taskDel.setData(rowData);initService._init(1)">删除</span> -->
                        <span class="TC-state TC-right-foot-green01" *ngIf="rowData.parentId==0&&rowData.completeStatus==1">已结案</span>
                        <span title="结案" class="btn-i" data-toggle="modal" data-target="#setMainTaskCompleteStatus" *ngIf="(rowData.createBy == server.getuserName() && rowData.parentId==0 && rowData.submitStatus==1 && (rowData.completeStatus==0 || rowData.completeStatus==null)) && (right['taskPermissionList']['closingCase'])"
                         (click)="compelteStatus.setData(rowData);initService._init(1)">
                         <img src="assets/new/ok.png" width="18px" height="18px">
                        </span>
                        <span class="TC-state TC-right-foot-green01" *ngIf="rowData.parentId!=0&&rowData.submitStatus == 1">已送审</span>
                        <span class="tableOperationText" data-toggle="modal" data-target="#setTaskSubmitStatus" *ngIf="(rowData.submitStatus == 0 && rowData.completeStatus==0) && (right['taskPermissionList']['submitReview'])" 
                        (click)="submitStatus.setData(rowData);initService._init(1)">送审</span>
                    </td>
                </tr>
            </ng-template>
        </p-treeTable>
    </div>
</div>

<!-- 删除任务弹窗BEGIN -->
<app-product-indexing-task-list-del #taskDel (delEvent)="getTasksList()"></app-product-indexing-task-list-del>
<!-- 删除任务弹窗END -->

<!-- 主任务结案BEGIN -->
<app-product-indexing-task-complete #compelteStatus (completeEvent)="getTasksList()"></app-product-indexing-task-complete>
<!-- 主任务结案END -->

<!-- 子任务送审BEGIN -->
<app-product-indexing-task-submit #submitStatus (submitEvent)="getTasksList()"></app-product-indexing-task-submit>
<!-- 子任务送审END -->